package com.lagou.task09;

public class FixedAccount extends Account {

    public FixedAccount(int i) {
        setMoney(i);
    }

    @Override
    public double getLixi() {
        return getMoney()*0.03;
    }

    public static void main(String[] args) {
        //1.声明一个Account类型的引用指向FixedAccount类型的对象，形成多态
        Account ac1 = new FixedAccount(1000);
        double lixi = ac1.getLixi();
        System.out.println("利息 = " + lixi);
    }
}
